home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / shopdrop.swf / scripts / __Packages / GrabPackage.as < prev    next >
Text File  |  2007-09-27  |  1KB  |  49 lines

  1. class GrabPackage extends MovieClip
  2. {
  3.    var bGrabbed = false;
  4.    static var NORMAL = 0;
  5.    static var BONUS = 1;
  6.    static var BALANCE = 2;
  7.    var nType = GrabPackage.NORMAL;
  8.    function GrabPackage()
  9.    {
  10.       super();
  11.    }
  12.    function update(nElapsed)
  13.    {
  14.       var _loc4_ = (- PackageHandler.ySpeed) * nElapsed;
  15.       this.lastY = this._y;
  16.       var _loc6_ = _loc4_ * this.direction.x;
  17.       this._x -= _loc6_;
  18.       this._y += _loc4_;
  19.       var _loc5_ = new smashing.Point(this.vanishing._x - this._x,this.vanishing._y - this._y);
  20.       var _loc3_ = Math.floor(_loc5_.dot(_loc5_) / this.distance2 * 100);
  21.       this._xscale = _loc3_;
  22.       this._yscale = _loc3_;
  23.       this.newDepth = this._y <= _global.nPlayerY ? 300 + this.nId : 600 + this.nId;
  24.       this.swapDepths(this.newDepth);
  25.       if(this._y <= this.vanishing._y)
  26.       {
  27.          this.handler.removeClip(this);
  28.       }
  29.    }
  30.    function toGiftCard()
  31.    {
  32.       this.a.pickup.gotoAndStop("maxStack");
  33.    }
  34.    function toPackage()
  35.    {
  36.       this.a.pickup.gotoAndStop("default");
  37.    }
  38.    function toBonusCard()
  39.    {
  40.       this.nType = GrabPackage.BONUS;
  41.       this.a.pickup.gotoAndStop("bonusCard");
  42.    }
  43.    function toBalanceIcon()
  44.    {
  45.       this.nType = GrabPackage.BALANCE;
  46.       this.a.pickup.gotoAndStop("balance");
  47.    }
  48. }
  49.